import Fetch from '../../utils/fetch'

const app = getApp<IAppOption>()

Page({
  data: {
    data: {},
    tracks: [],
  },

  async onLoad(option: any) {
    console.log(option.id);
    let id = option.id;
    if (!option.id) {
      id = 3220130759;
    }
    const res = await Fetch(`http://musicapi.leanapp.cn/playlist/detail?id=${id}`);
    console.log(res.data);
    this.setData({
      data: res.data.playlist,
      tracks: res.data.playlist.tracks,
    })
  },

})
